package project3;

import java.text.DecimalFormat;

/**Represents a single match to a query; stores the document that matched,
 * and its calculated goodness value.
 */
public class SearchResult
{
    /** Document that matched the search query */
	public Document document;
    /** How well the document matched the query */
    public double score;

    /** Builds a Search Result */
    public SearchResult(Document document, double score)
    {
		this.document=document;
		this.score=score;
    }
	
	private static DecimalFormat scoreFormat=new DecimalFormat("0.00000");
	public String toString()
	{
		return document+", Relevance "+scoreFormat.format(score);
	}
}
